import {
	myRequest
} from './http.js'
import store from '../store';
//登录
export function login(config) {
	return myRequest({
		url: 'shop/authorized',
		method: 'post',
		data: config
	})
}
//获取签名
export function jsdkSignature(config) {
	return myRequest({
		url: 'wechat/signature/',
		method: 'get',
		data: config
	})
}



//获取商铺信息
export function getshops(config) {
	return myRequest({
		url: 'shop/profile',
		method: 'get',
		data: config
	})
}

//获取订单
export function getorder(config) {
	return myRequest({
		url: `shop/orders`,
		method: 'get',
		data: config
	})
}

//获取一个订单
export function getorderone(config) {
	return myRequest({
		url: `shop/orders/` + config.id,
		method: 'get'
	})

}
//抢单子
export function orderstatus(config) {
	return myRequest({
		url: `shop/orders/` + config.id ,
		method: 'put',
		data: config
	})

}
//店铺上班下班
export function shopupdata(config) {
	return myRequest({
		url: `shop/profile`,
		method: 'put',
		data: config
	})

}

//获取商铺
export function getproducts(config) {
	return myRequest({
		url: `shop/products`,
		method: 'get',
		data: config
	})

}
//修改上商品
export function putproducts(config) {
	return myRequest({
		url: `shop/${store.state.shop_id}/products/${config.id}`,
		method: 'put',
		data: config
	})

}
//单独获取商品
export function getproductone(config) {
	return myRequest({
		url: `shop/${store.state.shop_id}/products/${config.id}`,
		method: 'get',
	})

}

//获取分类
export function getcategory(config) {
	return myRequest({
		url: `shop/${store.state.shop_id}/categories`,
		method: 'get',
	})

}
//获取钱包
export function postmoney(config) {
	return myRequest({
		url: `shop/${store.state.shop_id}/money`,
		method: 'post',
	})

}



